<?php
include 'util.php';

$id = $_POST['userid'];
$fileName ='src\json\gameStatus.json';
$myFile = file_get_contents($fileName);
$gameStatusArray = json_decode(prepareJSON($myFile), true);
// 修改游戏阶段：N：未选英雄；Y：已选英雄
$gameStatusArray['playerInfo'][$id-1]['phase'] = 'Y';
$gameStatusArray['playerInfo'][$id-1]['heroCard'] = $_POST['id'];
file_put_contents($fileName,json_encode($gameStatusArray));

?>